﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace DCS.Business.Model
{
    /// <summary>
    /// PFSMessage
    /// </summary>
    public class PFSMessage : ICloneable
    {
        /// <summary>
        /// PFSMessage 构造函数
        /// </summary>
        public PFSMessage()
        {
            this.PFSPassengers = new List<PFSPassenger>();
        }

        /// <summary>
        /// PFSMessage OR映射构造函数
        /// </summary>
        public PFSMessage(System.Data.IDataReader dr)
        {
            this.MessageId = (Guid)dr["MessageId"];
            this.Carrier = Convert.ToString(dr["Carrier"]);
            this.FlightNo = Convert.ToString(dr["FlightNo"]);
            this.PDate = Convert.ToDateTime(dr["PDate"]);
            this.DeptAirport = Convert.ToString(dr["DeptAirport"]);
            this.ArrAirport = Convert.ToString(dr["ArrAirport"]);
            this.PaxLayout = Convert.ToString(dr["PaxLayout"]);
            this.BoardedPassenger = Convert.ToString(dr["BoardedPassenger"]);
            this.PadPassenger = Convert.ToString(dr["PadPassenger"]);
            this.Baby = Convert.ToInt32(dr["Baby"]);
            this.TransitPassenger = Convert.ToString(dr["TransitPassenger"]);
            this.TransitBaby = Convert.ToInt32(dr["TransitBaby"]);
            this.SharedNo = Convert.ToString(dr["SharedNo"]);
            this.RefFileId = Convert.ToInt32(dr["RefFileId"]);
        }

        /// <summary>
        /// GUID唯一编号
        /// </summary>
        public Guid MessageId { get; set; }

        /// <summary>
        /// 承运人
        /// </summary>
        public string Carrier { get; set; }

        /// <summary>
        /// 航班号
        /// </summary>
        public string FlightNo { get; set; }

        /// <summary>
        /// 航班日期
        /// </summary>
        public DateTime PDate { get; set; }

        /// <summary>
        /// 起飞站
        /// </summary>
        public string DeptAirport { get; set; }

        /// <summary>
        /// 目标站
        /// </summary>
        public string ArrAirport { get; set; }

        /// <summary>
        /// 舱位布局
        /// </summary>
        public string PaxLayout { get; set; }

        /// <summary>
        /// 各舱位乘客人数
        /// </summary>
        public string BoardedPassenger { get; set; }

        /// <summary>
        /// 各舱位PAD旅客数
        /// </summary>
        public string PadPassenger { get; set; }

        /// <summary>
        /// 婴儿数
        /// </summary>
        public int Baby { get; set; }

        /// <summary>
        /// 联程旅客数
        /// </summary>
        public string TransitPassenger { get; set; }

        /// <summary>
        /// 联程婴儿数
        /// </summary>
        public int TransitBaby { get; set; }

        /// <summary>
        /// 共享航班号
        /// </summary>
        public string SharedNo { get; set; }

        /// <summary>
        /// 信息所包含的乘客记录
        /// </summary>
        public List<PFSPassenger> PFSPassengers { get; set; }

        /// <summary>
        /// 对应的DCS文件Id
        /// </summary>
        public int RefFileId { get; set; }

        #region ICloneable Members

        public object Clone()
        {
            return this.MemberwiseClone();
        }

        #endregion
    }

    public class MessageGroup
    {
        public List<PFSMessage> PFSList
        {
            set;
            get;
        }

        public List<PRLMessage> PRLList
        {
            get;
            set;
        }
    }
}

